package com.diudiutechnology.www.yadiudiu.yadiudiu.mine.MyActivity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import com.diudiutechnology.www.yadiudiu.R;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/8/24.
 * 实名认证
 */

public class AuthenticationActivity extends Activity implements View.OnClickListener {
    @Bind(R.id.retur)
    LinearLayout retur;

   @Bind(R.id.education_layout)//学历
   RelativeLayout education_layout;

    @Bind(R.id.driver_license_layout)//驾驶证
    RelativeLayout driver_license_layout;

    @Bind(R.id.driving_permit_layout)//行驶证
    RelativeLayout driving_permit_layout;
    Context context;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_authentication);
        ButterKnife.bind(this);
        context=this;
        initView();
    }

    private void initView() {
        retur.setOnClickListener(this);
        education_layout.setOnClickListener(this);
        driver_license_layout.setOnClickListener(this);
        driving_permit_layout.setOnClickListener(this);
    }
   // 跳页面 0、学历 1、驾驶证  2、行驶证
private void processIntent(String pos){
    Intent intent =new Intent(context,IdentityActivity.class);
    intent.putExtra("pos",pos);
    startActivity(intent);

}
    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.retur:
                finish();
                break;
            case R.id.education_layout://学历
                processIntent("0");
                break;
            case R.id.driver_license_layout://驾驶证
                processIntent("1");
                break;
            case R.id.driving_permit_layout://行驶证
                processIntent("2");
                break;
        }
    }
}
